﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ImobitechModel.com.Constantes;

namespace Imobitech
{
    public partial class front : System.Web.UI.MasterPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                menuLocatario.Visible = false;
                menuProprietario.Visible = false;
                logout.Visible = false;
                if (Session["login"] != null)
                {
                    login.Visible = false;
                    logout.Visible = true;
                    Logar logar = (Logar)Session["login"];
                    campologin.InnerText = "Bem-vindo " + logar.nome;

                    for (int index = 0; index < logar.papeis.Count; index++)
                    {
                        if (logar.papeis[index].nome == "Locatario")
                            menuLocatario.Visible = true;
                        if (logar.papeis[index].nome == "dono")
                            menuProprietario.Visible = true;
                    }


                }
            }
        }
    }
}